import Vue from 'vue'
import 'element-ui/lib/theme-chalk/base.css';
import ElEmpty from 'element-ui/packages/empty'

import {
  // Basic
  Row,
  Col,
  Button,
  // ButtonGroup,
  Card,

  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxGroup,
  Input,
  InputNumber,
  Select,
  Option,
  // OptionGroup,
  DatePicker,
  TimeSelect,
  TimePicker,
  Upload,
  Form,
  FormItem,
  Link,
  Cascader,
  CascaderPanel,
  Switch,

  // Data
  Table,
  TableColumn,
  Progress,
  Tree,
  Pagination,
  Tag,

  // Notice
  Alert,
  Loading,
  Message,
  MessageBox,

  // Navigation
  // PageHeader,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Tabs,
  TabPane,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Steps,
  Step,
  Breadcrumb,
  BreadcrumbItem,
  Divider,
  // Others
  Dialog,
  Tooltip,
  Popover,
  // Scrollbar,
  Popconfirm,
  Backtop,
  Autocomplete,
  Badge,
  Notification
} from 'element-ui'

const components = [
  // Base
  Row,
  Col,
  Button,
  // ButtonGroup,
  Card,

  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxGroup,
  Input,
  InputNumber,
  Select,
  Option,
  // OptionGroup,
  DatePicker,
  TimeSelect,
  TimePicker,
  Upload,
  Form,
  FormItem,
  Link,
  Cascader,
  CascaderPanel,
  Switch,

  // Data
  Table,
  TableColumn,
  Progress,
  Tree,
  Pagination,
  Tag,

  // Notice
  Alert,

  // Navigation
  // PageHeader,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Tabs,
  TabPane,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Steps,
  Step,
  Breadcrumb,
  BreadcrumbItem,
  Divider,
  // Others
  Dialog,
  Tooltip,
  Popover,
  // Scrollbar,
  Popconfirm,
  Backtop,
  Autocomplete,
  Badge,
  ElEmpty
]

// 循环注册全局组件
components.forEach(item => {
  Vue.use(item)
})
Vue.use(Loading.directive)

Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message
Vue.prototype.$notify = Notification
